package com.licq.hongmeng.net;



import com.licq.hongmeng.bean.BaseBean;
import com.licq.hongmeng.bean.JokeBean;
import com.licq.hongmeng.bean.UserInfo;
import retrofit2.Call;

import java.util.ArrayList;


/**
 * 网络请求
 */
public class MobileApi  {

    private MobileApiInterface mobileApiInterface;

    private MobileApi() {
        mobileApiInterface = RetrofitUtil.getInstance().create(MobileApiInterface.class);
    }

    public static MobileApi getInstance() {
        return SingletonHolder.INSTANCE;
    }

    private static class SingletonHolder {
        public static MobileApi INSTANCE = new MobileApi();
    }

    /**
     * 获取消息
     */
    public Call<BaseBean> communal4_tabAd(String code, int location) {
        return mobileApiInterface.getnotice(code, location);
    }

    /**
     * 登录
     */
    public Call<BaseBean<UserInfo>> communal4_tabAdOnly(UserInfo userInfo) {
        return  mobileApiInterface.login(userInfo);
    }

    /**
     * @param page 页码
     * @param count 数量
     * @param type 类型 video
     * @return Object
     */
    public Call<BaseBean<ArrayList<JokeBean>>> getJoke(int page, int count, String type) {
        return mobileApiInterface.getJoke(page, count, type);

    }

}
